my_dict = {}

# 方法1
if len(my_dict) == 0:
    print("The dictionary is empty.")
else:
    print("The dictionary is not empty.")
    

# 方法2
if not my_dict:
    print("The dictionary is empty.")
else:
    print("The dictionary is not empty.")
